//
//  NMPOSettingCell.swift
//  NMPO
//
//  Created by PowerfullClean on 2023/10/31.
//

import UIKit

class NMPOSettingCell: UICollectionViewCell {
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView.addSubview(nmpo_iconView)
        contentView.addSubview(nmpo_titleLabel)
        nmpo_iconView.snp.makeConstraints { make in
            make.size.equalTo(16)
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(50)
        }
        nmpo_titleLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(nmpo_iconView.snp.right).offset(12)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    var nmpo_settingModel: NMPOSettingModel? {
        didSet {
            guard let nmpo_settingModel = nmpo_settingModel else { return  }
            nmpo_iconView.image = UIImage(named: nmpo_settingModel.nmpo_icon)
            nmpo_titleLabel.text = nmpo_settingModel.nmpo_title
        }
    }
    lazy var nmpo_iconView: UIImageView = {
        let nmpo_iconView = UIImageView(image: UIImage(named: "nmpo_setting_rate"))
        return nmpo_iconView
    }()
    lazy var nmpo_titleLabel: UILabel = {
        let nmpo_titleLabel = UILabel()
        nmpo_titleLabel.font = UIFont.systemFont(ofSize: 12)
        nmpo_titleLabel.textColor = NMPOCommon.nmpo_getHXColorValue(rgb: 0xFFFFFF)
        nmpo_titleLabel.text = "Speed"
        return nmpo_titleLabel
    }()
}
